﻿using Vigenere.Models;


namespace Vigenere
{
    /// <summary>
    /// 输入原文和密钥，并输出密文
    /// </summary>
    internal class Program
    {
        static void Main(string[] args)
        {
            //输入
            Console.WriteLine("请输入原文");
            string MyPlain = Console.ReadLine();
            Console.WriteLine("请输入密钥");
            string MyKey = Console.ReadLine();

            //加密并输出
            List<int> Key = new List<int>();
            List<int> Plain = new List<int>();
            List<int> Cipher = new List<int>();
            List<char> Ciphertext = new List<char>();
            Encode encode = new Encode();
            MyEncode myEncode = new MyEncode();
            myEncode.PlainInput = MyPlain;
            myEncode.KeyInput = MyKey;
            encode.ToNum(Key, Plain, myEncode.KeyInput,myEncode.PlainInput);        //将原文和密钥转为数字
            encode.Vigenerefun(myEncode, Key, Plain, Cipher, Ciphertext);           //加密函数
           
        }
    }
}